using System.Drawing;
using NetTopologySuite.Geometries;

namespace ZMap.TileGrid
{
    public class TileGrid
    {
        /// <summary>
        /// Resolutions. The array index of each resolution needs
        /// to match the zoom level. This means that even if a `minZoom` is configured, the resolutions
        /// array will have a length of `maxZoom + 1`.
        /// </summary>
        public double[] Resolutions { get; set; }

        /// <summary>
        /// 最大分辨率
        /// </summary>
        public double MaxResolution { get; set; }

        /// <summary>
        /// 最小分辨率
        /// </summary>
        public double MinResolution { get; set; }

        /// <summary>
        /// Minimum zoom
        /// </summary>
        public double MinZoom { get; set; }

        /// <summary>
        /// 最小缩放级别
        /// </summary>
        public double MaxZoom { get; set; }

        /// <summary>
        /// 放大因子
        /// </summary>
        public double ZoomFactor { get; set; }

        /// <summary>
        /// The tile grid origin, i.e. where the `x`
        /// and `y` axes meet (`[z, 0, 0]`). Tile coordinates increase left to right and downwards. If not
        /// specified, `extent` or `origins` must be provided.
        /// </summary>
        public Coordinate Origin { get; set; }

        /// <summary>
        /// Number of tile rows and columns
        /// of the grid for each zoom level. If specified the values
        /// define each zoom level's extent together with the `origin` or `origins`.
        /// A grid `extent` can be configured in addition, and will further limit the extent
        /// for which tile requests are made by sources. If the bottom-left corner of
        /// an extent is used as `origin` or `origins`, then the `y` value must be
        /// negative because OpenLayers tile coordinates use the top left as the origin.
        /// </summary>
        public Size[] Sizes { get; set; }

        /// <summary>
        /// Tile grid origins, i.e. where
        /// the `x` and `y` axes meet (`[z, 0, 0]`), for each zoom level. If given, the array length
        /// should match the length of the `resolutions` array, i.e. each resolution can have a different
        /// origin. Tile coordinates increase left to right and downwards. If not specified, `extent` or
        /// `origin` must be provided.
        /// </summary>
        public Coordinate Origins { get; set; }

        /// <summary>
        /// Extent for the tile grid. No tiles outside this
        /// extent will be requested by ITileSource. When no `origin` or
        /// `origins` are configured, the `origin` will be set to the top-left corner of the extent.
        /// </summary>
        public Envelope Extent { get; set; }

        /// <summary>
        /// Tile size.
        /// Default is `[256, 256]`.
        /// </summary>
        public Size TileSize { get; set; }

        /// <summary>
        /// Tile sizes. If given, the array length
        /// should match the length of the `resolutions` array, i.e. each resolution can have a different
        /// tile size.
        /// </summary>
        public Size[] TileSizes { get; set; }
    }
}